<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Cheetah Software: test_cheetah3_model.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Cheetah Software
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
      <li><a href="../../globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d4/dc6/test__cheetah3__model_8cpp.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">test_cheetah3_model.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html">Dynamics/FloatingBaseModel.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="../../d3/dc7/_quadruped_8h_source.html">Dynamics/Quadruped.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="../../de/df0/utilities_8h_source.html">Utilities/utilities.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="../../d6/dce/_cheetah3_8h_source.html">include/Dynamics/Cheetah3.h</a>&quot;</code><br />
<code>#include &quot;gmock/gmock.h&quot;</code><br />
<code>#include &quot;gtest/gtest.h&quot;</code><br />
<code>#include &lt;stdio.h&gt;</code><br />
</div><div class="textblock"><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Include dependency graph for test_cheetah3_model.cpp:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d5/d43/test__cheetah3__model_8cpp__incl.png" border="0" usemap="#test__cheetah3__model_8cpp" alt=""/></div>
<map name="test__cheetah3__model_8cpp" id="test__cheetah3__model_8cpp">
</map>
</div>
</div>
<p><a href="../../d4/dc6/test__cheetah3__model_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae0a791e1383a7227ea33c31f94bca12d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp.html#ae0a791e1383a7227ea33c31f94bca12d">TEST</a> (Cheetah3, simulatorDynamicsDoesntCrashCheetah3)</td></tr>
<tr class="separator:ae0a791e1383a7227ea33c31f94bca12d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7598956e2c6b4bdb4bf66715f572984c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp.html#a7598956e2c6b4bdb4bf66715f572984c">TEST</a> (Cheetah3, simulatorContactInertiaCheetah3)</td></tr>
<tr class="separator:a7598956e2c6b4bdb4bf66715f572984c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03e4dad72d0c30d97e71f4b29c1c5b1b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp.html#a03e4dad72d0c30d97e71f4b29c1c5b1b">TEST</a> (Cheetah3, simulatorTestForceCheetah3)</td></tr>
<tr class="separator:a03e4dad72d0c30d97e71f4b29c1c5b1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ae0a791e1383a7227ea33c31f94bca12d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype">Cheetah3&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simulatorDynamicsDoesntCrashCheetah3&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a cheetah model and runs forward kinematics and ABA Doesn't test anyting - this is just to make sure it doesn't crash </p>

<p>Definition at line <a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp_source.html#l00025">25</a> of file <a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp_source.html">test_cheetah3_model.cpp</a>.</p>

<p>References <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00238">FloatingBaseModel&lt; T &gt;::_nDof</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l00479">FloatingBaseModel&lt; T &gt;::forwardKinematics()</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00061">FBModelStateDerivative&lt; T &gt;::qdd</a>, and <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l00880">FloatingBaseModel&lt; T &gt;::runABA()</a>.</p>
<div class="fragment"><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;                                                     {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;  <a class="code" href="../../d6/db1/class_floating_base_model.html">FloatingBaseModel&lt;double&gt;</a> <a class="code" href="../../d7/dfa/namespacecheetah.html">cheetah</a> = buildCheetah3&lt;double&gt;().buildModel();</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> tau(12);</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <a class="code" href="../../de/dce/struct_f_b_model_state_derivative.html">FBModelStateDerivative&lt;double&gt;</a> _dstate;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  _dstate.<a class="code" href="../../de/dce/struct_f_b_model_state_derivative.html#af32a2041b72e6b30ed1c8a027d340fd2">qdd</a> = <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;::Zero</a>(cheetah.<a class="code" href="../../d6/db1/class_floating_base_model.html#a96762b2003a96d46767b15d7a3d083ea">_nDof</a> - 6);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  cheetah.<a class="code" href="../../d6/db1/class_floating_base_model.html#a4c4c27d3bc26c3ad1a3306d16b57f085">forwardKinematics</a>();</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  cheetah.<a class="code" href="../../d6/db1/class_floating_base_model.html#a620e24c0c340885940f610875a35f3c7">runABA</a>(tau, _dstate);</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;}</div><div class="ttc" id="namespacecheetah_html"><div class="ttname"><a href="../../d7/dfa/namespacecheetah.html">cheetah</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d3/dc7/_quadruped_8h_source.html#l00021">Quadruped.h:21</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a620e24c0c340885940f610875a35f3c7"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a620e24c0c340885940f610875a35f3c7">FloatingBaseModel::runABA</a></div><div class="ttdeci">void runABA(const DVec&lt; T &gt; &amp;tau, FBModelStateDerivative&lt; T &gt; &amp;dstate)</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l00880">FloatingBaseModel.cpp:880</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a4c4c27d3bc26c3ad1a3306d16b57f085"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a4c4c27d3bc26c3ad1a3306d16b57f085">FloatingBaseModel::forwardKinematics</a></div><div class="ttdeci">void forwardKinematics()</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l00479">FloatingBaseModel.cpp:479</a></div></div>
<div class="ttc" id="struct_f_b_model_state_derivative_html"><div class="ttname"><a href="../../de/dce/struct_f_b_model_state_derivative.html">FBModelStateDerivative&lt; double &gt;</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a96762b2003a96d46767b15d7a3d083ea"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a96762b2003a96d46767b15d7a3d083ea">FloatingBaseModel::_nDof</a></div><div class="ttdeci">size_t _nDof</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00238">FloatingBaseModel.h:238</a></div></div>
<div class="ttc" id="class_floating_base_model_html"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html">FloatingBaseModel&lt; double &gt;</a></div></div>
<div class="ttc" id="struct_f_b_model_state_derivative_html_af32a2041b72e6b30ed1c8a027d340fd2"><div class="ttname"><a href="../../de/dce/struct_f_b_model_state_derivative.html#af32a2041b72e6b30ed1c8a027d340fd2">FBModelStateDerivative::qdd</a></div><div class="ttdeci">DVec&lt; T &gt; qdd</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00061">FloatingBaseModel.h:61</a></div></div>
<div class="ttc" id="cpp_types_8h_html_ae2e5a0a178a2c528d8aa939f85db7a3e"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, Eigen::Dynamic, 1 &gt; DVec</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00102">cppTypes.h:102</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d4/dc6/test__cheetah3__model_8cpp_ae0a791e1383a7227ea33c31f94bca12d_cgraph.png" border="0" usemap="#d4/dc6/test__cheetah3__model_8cpp_ae0a791e1383a7227ea33c31f94bca12d_cgraph" alt=""/></div>
<map name="d4/dc6/test__cheetah3__model_8cpp_ae0a791e1383a7227ea33c31f94bca12d_cgraph" id="d4/dc6/test__cheetah3__model_8cpp_ae0a791e1383a7227ea33c31f94bca12d_cgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a7598956e2c6b4bdb4bf66715f572984c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype">Cheetah3&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simulatorContactInertiaCheetah3&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Run the contact inertia algorithm for cheetah 3 Set a weird body orientation, velocity, q, dq, and tau Checks that it matches the result from J H^(-1) J^T </p>

<p>Definition at line <a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp_source.html#l00040">40</a> of file <a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp_source.html">test_cheetah3_model.cpp</a>.</p>

<p>References <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00288">FloatingBaseModel&lt; T &gt;::_Jc</a>, <a class="el" href="../../de/dda/_math_utilities_8h_source.html#l00023">almostEqual()</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00040">FBModelState&lt; T &gt;::bodyOrientation</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00041">FBModelState&lt; T &gt;::bodyPosition</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00042">FBModelState&lt; T &gt;::bodyVelocity</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l00548">FloatingBaseModel&lt; T &gt;::contactJacobians()</a>, <a class="el" href="../../d4/dfb/orientation__tools_8h_source.html#l00060">ori::coordinateRotation()</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l01065">FloatingBaseModel&lt; T &gt;::invContactInertia()</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l00778">FloatingBaseModel&lt; T &gt;::massMatrix()</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00043">FBModelState&lt; T &gt;::q</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00044">FBModelState&lt; T &gt;::qd</a>, <a class="el" href="../../d4/dfb/orientation__tools_8h_source.html#l00119">ori::rotationMatrixToQuaternion()</a>, and <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00191">FloatingBaseModel&lt; T &gt;::setState()</a>.</p>
<div class="fragment"><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;                                                {</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  <a class="code" href="../../d6/db1/class_floating_base_model.html">FloatingBaseModel&lt;double&gt;</a> cheetahModel = buildCheetah3&lt;double&gt;().buildModel();</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a0b83d93a3c74d282558436e26c056896">RotMat&lt;double&gt;</a> rBody = <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(CoordinateAxis::X, .123) *</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;                         <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(CoordinateAxis::Z, .232) *</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;                         <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(CoordinateAxis::Y, .111);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a3d70f8eb9cf1855ca989f887a5543acc">SVec&lt;double&gt;</a> bodyVel;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  bodyVel &lt;&lt; 1, 2, 3, 4, 5, 6;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <a class="code" href="../../de/d75/struct_f_b_model_state.html">FBModelState&lt;double&gt;</a> x;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> q(12);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> dq(12);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> tauref(12);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; 12; i++) {</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    q[i] = i + 1;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    dq[i] = (i + 1) * 2;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    tauref[i] = (i + 1) * -30.;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  }</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;  <span class="comment">// set state</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#ae42e1f0d68b89af761bcaf273b97bca7">bodyOrientation</a> = <a class="code" href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">rotationMatrixToQuaternion</a>(rBody.transpose());</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#abf1fc0221d6b92d103193524a2046ffc">bodyVelocity</a> = bodyVel;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#abbf400085816b6baa4e4a0597ac5b118">bodyPosition</a> = <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;double&gt;</a>(6, 7, 8);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#ae5a66b0d3fecb2cdd9ee3c68f72e9182">q</a> = q;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#a97f42a6014fc5d9fd3dc22f7158099f4">qd</a> = dq;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  <span class="comment">// do aba</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a575819811abf1d4b8e527b22aead4013">setState</a>(x);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#afca11b3f8d117a20990d309666e1a8f3">contactJacobians</a>();</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat&lt;double&gt;</a> H = cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a73d58fada538f7d74ad94c48e5024b78">massMatrix</a>();</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a190e396ab8cb0eb974ad2a5195edcb24">D3Mat&lt;double&gt;</a> J0 = cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a202ffc31ffb2be152fbd3e7ae88e6aa6">_Jc</a>[15];</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat&lt;double&gt;</a> LambdaInv1 = J0 * H.colPivHouseholderQr().solve(J0.transpose());</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a0231caceb234a1eace8c03dda00431dd">D6Mat&lt;double&gt;</a> forceOnly = <a class="code" href="../../d9/d8e/cpp_types_8h.html#a0231caceb234a1eace8c03dda00431dd">D6Mat&lt;double&gt;::Zero</a>(6, 3);</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  forceOnly.bottomRows&lt;3&gt;() = <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;double&gt;::Identity</a>();</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat&lt;double&gt;</a> LambdaInv2 = cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a759338421e6adbe3a0a69e42271d43d4">invContactInertia</a>(15, forceOnly);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  EXPECT_TRUE(<a class="code" href="../../de/dda/_math_utilities_8h.html#aa06ec79f1e3170ea41b58ffbf35b9fb6">almostEqual</a>(LambdaInv1, LambdaInv2, .001));</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;}</div><div class="ttc" id="struct_f_b_model_state_html_abbf400085816b6baa4e4a0597ac5b118"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#abbf400085816b6baa4e4a0597ac5b118">FBModelState::bodyPosition</a></div><div class="ttdeci">Vec3&lt; T &gt; bodyPosition</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00041">FloatingBaseModel.h:41</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_abf1fc0221d6b92d103193524a2046ffc"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#abf1fc0221d6b92d103193524a2046ffc">FBModelState::bodyVelocity</a></div><div class="ttdeci">SVec&lt; T &gt; bodyVelocity</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00042">FloatingBaseModel.h:42</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a0231caceb234a1eace8c03dda00431dd"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a0231caceb234a1eace8c03dda00431dd">D6Mat</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 6, Eigen::Dynamic &gt; D6Mat</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00110">cppTypes.h:110</a></div></div>
<div class="ttc" id="namespaceori_html_a537b8d0769c03e4cd8ef2b9a9dc8a760"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">ori::coordinateRotation</a></div><div class="ttdeci">Mat3&lt; T &gt; coordinateRotation(CoordinateAxis axis, T theta)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00060">orientation_tools.h:60</a></div></div>
<div class="ttc" id="cpp_types_8h_html_aa8cb424e643d476ea485238dad7c3e18"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 3 &gt; Mat3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00054">cppTypes.h:54</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a807200f3771dbd2cb2e4be52c5f2518c"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, Eigen::Dynamic, Eigen::Dynamic &gt; DMat</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00106">cppTypes.h:106</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_ae5a66b0d3fecb2cdd9ee3c68f72e9182"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#ae5a66b0d3fecb2cdd9ee3c68f72e9182">FBModelState::q</a></div><div class="ttdeci">DVec&lt; T &gt; q</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00043">FloatingBaseModel.h:43</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_a97f42a6014fc5d9fd3dc22f7158099f4"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#a97f42a6014fc5d9fd3dc22f7158099f4">FBModelState::qd</a></div><div class="ttdeci">DVec&lt; T &gt; qd</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00044">FloatingBaseModel.h:44</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a6f07728c866b15ff0676a9b2ebfd2ba6"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 1 &gt; Vec3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00026">cppTypes.h:26</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a190e396ab8cb0eb974ad2a5195edcb24"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a190e396ab8cb0eb974ad2a5195edcb24">D3Mat</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, Eigen::Dynamic &gt; D3Mat</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00114">cppTypes.h:114</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a3d70f8eb9cf1855ca989f887a5543acc"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a3d70f8eb9cf1855ca989f887a5543acc">SVec</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 6, 1 &gt; SVec</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00062">cppTypes.h:62</a></div></div>
<div class="ttc" id="class_floating_base_model_html_afca11b3f8d117a20990d309666e1a8f3"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#afca11b3f8d117a20990d309666e1a8f3">FloatingBaseModel::contactJacobians</a></div><div class="ttdeci">void contactJacobians()</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l00548">FloatingBaseModel.cpp:548</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html">FBModelState&lt; double &gt;</a></div></div>
<div class="ttc" id="namespaceori_html_a73c3872af6870d856cedd662856fcaea"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">ori::rotationMatrixToQuaternion</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; rotationMatrixToQuaternion(const Eigen::MatrixBase&lt; T &gt; &amp;r1)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00119">orientation_tools.h:119</a></div></div>
<div class="ttc" id="_math_utilities_8h_html_aa06ec79f1e3170ea41b58ffbf35b9fb6"><div class="ttname"><a href="../../de/dda/_math_utilities_8h.html#aa06ec79f1e3170ea41b58ffbf35b9fb6">almostEqual</a></div><div class="ttdeci">bool almostEqual(const Eigen::MatrixBase&lt; T &gt; &amp;a, const Eigen::MatrixBase&lt; T &gt; &amp;b, T2 tol)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/dda/_math_utilities_8h_source.html#l00023">MathUtilities.h:23</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a575819811abf1d4b8e527b22aead4013"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a575819811abf1d4b8e527b22aead4013">FloatingBaseModel::setState</a></div><div class="ttdeci">void setState(const FBModelState&lt; T &gt; &amp;state)</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00191">FloatingBaseModel.h:191</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a759338421e6adbe3a0a69e42271d43d4"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a759338421e6adbe3a0a69e42271d43d4">FloatingBaseModel::invContactInertia</a></div><div class="ttdeci">DMat&lt; T &gt; invContactInertia(const int gc_index, const D6Mat&lt; T &gt; &amp;force_directions)</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l01065">FloatingBaseModel.cpp:1065</a></div></div>
<div class="ttc" id="class_floating_base_model_html"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html">FloatingBaseModel&lt; double &gt;</a></div></div>
<div class="ttc" id="cpp_types_8h_html_ae2e5a0a178a2c528d8aa939f85db7a3e"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, Eigen::Dynamic, 1 &gt; DVec</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00102">cppTypes.h:102</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a202ffc31ffb2be152fbd3e7ae88e6aa6"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a202ffc31ffb2be152fbd3e7ae88e6aa6">FloatingBaseModel::_Jc</a></div><div class="ttdeci">vectorAligned&lt; D3Mat&lt; T &gt; &gt; _Jc</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00288">FloatingBaseModel.h:288</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a73d58fada538f7d74ad94c48e5024b78"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a73d58fada538f7d74ad94c48e5024b78">FloatingBaseModel::massMatrix</a></div><div class="ttdeci">DMat&lt; T &gt; massMatrix()</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l00778">FloatingBaseModel.cpp:778</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a0b83d93a3c74d282558436e26c056896"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a0b83d93a3c74d282558436e26c056896">RotMat</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 3 &gt; RotMat</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00018">cppTypes.h:18</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_ae42e1f0d68b89af761bcaf273b97bca7"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#ae42e1f0d68b89af761bcaf273b97bca7">FBModelState::bodyOrientation</a></div><div class="ttdeci">EIGEN_MAKE_ALIGNED_OPERATOR_NEW Quat&lt; T &gt; bodyOrientation</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00040">FloatingBaseModel.h:40</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-2" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-2-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-2-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-2-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d4/dc6/test__cheetah3__model_8cpp_a7598956e2c6b4bdb4bf66715f572984c_cgraph.png" border="0" usemap="#d4/dc6/test__cheetah3__model_8cpp_a7598956e2c6b4bdb4bf66715f572984c_cgraph" alt=""/></div>
<map name="d4/dc6/test__cheetah3__model_8cpp_a7598956e2c6b4bdb4bf66715f572984c_cgraph" id="d4/dc6/test__cheetah3__model_8cpp_a7598956e2c6b4bdb4bf66715f572984c_cgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a03e4dad72d0c30d97e71f4b29c1c5b1b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TEST </td>
          <td>(</td>
          <td class="paramtype">Cheetah3&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simulatorTestForceCheetah3&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Check a test force for cheetah 3 Set a weird body orientation, velocity, q, dq, and tau Checks the result matches qdd = H^(-1) J^T F </p>

<p>Definition at line <a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp_source.html#l00086">86</a> of file <a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp_source.html">test_cheetah3_model.cpp</a>.</p>

<p>References <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00288">FloatingBaseModel&lt; T &gt;::_Jc</a>, <a class="el" href="../../de/dda/_math_utilities_8h_source.html#l00023">almostEqual()</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l00962">FloatingBaseModel&lt; T &gt;::applyTestForce()</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00040">FBModelState&lt; T &gt;::bodyOrientation</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00041">FBModelState&lt; T &gt;::bodyPosition</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00042">FBModelState&lt; T &gt;::bodyVelocity</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l00548">FloatingBaseModel&lt; T &gt;::contactJacobians()</a>, <a class="el" href="../../d4/dfb/orientation__tools_8h_source.html#l00060">ori::coordinateRotation()</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00060">FBModelStateDerivative&lt; T &gt;::dBodyVelocity</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l01065">FloatingBaseModel&lt; T &gt;::invContactInertia()</a>, <a class="el" href="../../da/de7/_floating_base_model_8cpp_source.html#l00778">FloatingBaseModel&lt; T &gt;::massMatrix()</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00043">FBModelState&lt; T &gt;::q</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00044">FBModelState&lt; T &gt;::qd</a>, <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00061">FBModelStateDerivative&lt; T &gt;::qdd</a>, <a class="el" href="../../d4/dfb/orientation__tools_8h_source.html#l00119">ori::rotationMatrixToQuaternion()</a>, and <a class="el" href="../../d5/d9a/_floating_base_model_8h_source.html#l00191">FloatingBaseModel&lt; T &gt;::setState()</a>.</p>
<div class="fragment"><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                                           {</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <a class="code" href="../../d6/db1/class_floating_base_model.html">FloatingBaseModel&lt;double&gt;</a> cheetahModel = buildCheetah3&lt;double&gt;().buildModel();</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a0b83d93a3c74d282558436e26c056896">RotMat&lt;double&gt;</a> rBody = <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(CoordinateAxis::X, .123) *</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;                         <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(CoordinateAxis::Z, .232) *</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;                         <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(CoordinateAxis::Y, .111);</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a3d70f8eb9cf1855ca989f887a5543acc">SVec&lt;double&gt;</a> bodyVel;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  bodyVel &lt;&lt; 1, 2, 3, 4, 5, 6;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  <a class="code" href="../../de/d75/struct_f_b_model_state.html">FBModelState&lt;double&gt;</a> x;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> q(12);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> dq(12);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> tauref(12);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; 12; i++) {</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    q[i] = i + 1;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    dq[i] = (i + 1) * 2;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    tauref[i] = (i + 1) * -30.;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  }</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  <span class="comment">// set state</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#ae42e1f0d68b89af761bcaf273b97bca7">bodyOrientation</a> = <a class="code" href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">rotationMatrixToQuaternion</a>(rBody.transpose());</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#abf1fc0221d6b92d103193524a2046ffc">bodyVelocity</a> = bodyVel;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#abbf400085816b6baa4e4a0597ac5b118">bodyPosition</a> = <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;double&gt;</a>(6, 7, 8);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#ae5a66b0d3fecb2cdd9ee3c68f72e9182">q</a> = q;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  x.<a class="code" href="../../de/d75/struct_f_b_model_state.html#a97f42a6014fc5d9fd3dc22f7158099f4">qd</a> = dq;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;  <a class="code" href="../../de/dce/struct_f_b_model_state_derivative.html">FBModelStateDerivative&lt;double&gt;</a> dx;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  dx.<a class="code" href="../../de/dce/struct_f_b_model_state_derivative.html#af32a2041b72e6b30ed1c8a027d340fd2">qdd</a>.setZero(12);</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a575819811abf1d4b8e527b22aead4013">setState</a>(x);</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#afca11b3f8d117a20990d309666e1a8f3">contactJacobians</a>();</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat&lt;double&gt;</a> H = cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a73d58fada538f7d74ad94c48e5024b78">massMatrix</a>();</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat&lt;double&gt;</a> J0 = cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a202ffc31ffb2be152fbd3e7ae88e6aa6">_Jc</a>[15].bottomRows(1);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;double&gt;</a> zforce;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  zforce &lt;&lt; 0, 0, 1;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  <span class="keywordtype">double</span> foot_accel_in_z = cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a1edbea0371cffe8692a83ae5a9396e41">applyTestForce</a>(15, zforce, dx);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> qddFull = H.colPivHouseholderQr().solve(J0.transpose());</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat&lt;double&gt;</a> LambdaInv = J0 * qddFull;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a3d70f8eb9cf1855ca989f887a5543acc">SVec&lt;double&gt;</a> dBodyVelocity = qddFull.head&lt;6&gt;();</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec&lt;double&gt;</a> qdd = qddFull.tail(12);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="keywordtype">double</span> foot_accel_2 = LambdaInv(0, 0);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;  <span class="keywordtype">double</span> LambdaInv2 = cheetahModel.<a class="code" href="../../d6/db1/class_floating_base_model.html#a759338421e6adbe3a0a69e42271d43d4">invContactInertia</a>(15, zforce);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  EXPECT_TRUE(<a class="code" href="../../de/dda/_math_utilities_8h.html#aa06ec79f1e3170ea41b58ffbf35b9fb6">almostEqual</a>(dBodyVelocity, dx.<a class="code" href="../../de/dce/struct_f_b_model_state_derivative.html#a8b7b6d70f1b1268f02e1b291dad26c5d">dBodyVelocity</a>, .001));</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  EXPECT_TRUE(<a class="code" href="../../de/dda/_math_utilities_8h.html#aa06ec79f1e3170ea41b58ffbf35b9fb6">almostEqual</a>(qdd, dx.<a class="code" href="../../de/dce/struct_f_b_model_state_derivative.html#af32a2041b72e6b30ed1c8a027d340fd2">qdd</a>, 1e-6));</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  EXPECT_TRUE(abs(foot_accel_2 - foot_accel_in_z) &lt; .001);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  EXPECT_TRUE(abs(LambdaInv2 - foot_accel_in_z) &lt; .001);</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  qdd(0) += 5;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;  EXPECT_FALSE(<a class="code" href="../../de/dda/_math_utilities_8h.html#aa06ec79f1e3170ea41b58ffbf35b9fb6">almostEqual</a>(qdd, dx.<a class="code" href="../../de/dce/struct_f_b_model_state_derivative.html#af32a2041b72e6b30ed1c8a027d340fd2">qdd</a>, 1e-6));</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;}</div><div class="ttc" id="struct_f_b_model_state_html_abbf400085816b6baa4e4a0597ac5b118"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#abbf400085816b6baa4e4a0597ac5b118">FBModelState::bodyPosition</a></div><div class="ttdeci">Vec3&lt; T &gt; bodyPosition</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00041">FloatingBaseModel.h:41</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_abf1fc0221d6b92d103193524a2046ffc"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#abf1fc0221d6b92d103193524a2046ffc">FBModelState::bodyVelocity</a></div><div class="ttdeci">SVec&lt; T &gt; bodyVelocity</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00042">FloatingBaseModel.h:42</a></div></div>
<div class="ttc" id="namespaceori_html_a537b8d0769c03e4cd8ef2b9a9dc8a760"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">ori::coordinateRotation</a></div><div class="ttdeci">Mat3&lt; T &gt; coordinateRotation(CoordinateAxis axis, T theta)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00060">orientation_tools.h:60</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a807200f3771dbd2cb2e4be52c5f2518c"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a807200f3771dbd2cb2e4be52c5f2518c">DMat</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, Eigen::Dynamic, Eigen::Dynamic &gt; DMat</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00106">cppTypes.h:106</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_ae5a66b0d3fecb2cdd9ee3c68f72e9182"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#ae5a66b0d3fecb2cdd9ee3c68f72e9182">FBModelState::q</a></div><div class="ttdeci">DVec&lt; T &gt; q</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00043">FloatingBaseModel.h:43</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_a97f42a6014fc5d9fd3dc22f7158099f4"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#a97f42a6014fc5d9fd3dc22f7158099f4">FBModelState::qd</a></div><div class="ttdeci">DVec&lt; T &gt; qd</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00044">FloatingBaseModel.h:44</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a6f07728c866b15ff0676a9b2ebfd2ba6"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 1 &gt; Vec3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00026">cppTypes.h:26</a></div></div>
<div class="ttc" id="struct_f_b_model_state_derivative_html_a8b7b6d70f1b1268f02e1b291dad26c5d"><div class="ttname"><a href="../../de/dce/struct_f_b_model_state_derivative.html#a8b7b6d70f1b1268f02e1b291dad26c5d">FBModelStateDerivative::dBodyVelocity</a></div><div class="ttdeci">SVec&lt; T &gt; dBodyVelocity</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00060">FloatingBaseModel.h:60</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a3d70f8eb9cf1855ca989f887a5543acc"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a3d70f8eb9cf1855ca989f887a5543acc">SVec</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 6, 1 &gt; SVec</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00062">cppTypes.h:62</a></div></div>
<div class="ttc" id="class_floating_base_model_html_afca11b3f8d117a20990d309666e1a8f3"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#afca11b3f8d117a20990d309666e1a8f3">FloatingBaseModel::contactJacobians</a></div><div class="ttdeci">void contactJacobians()</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l00548">FloatingBaseModel.cpp:548</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html">FBModelState&lt; double &gt;</a></div></div>
<div class="ttc" id="namespaceori_html_a73c3872af6870d856cedd662856fcaea"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">ori::rotationMatrixToQuaternion</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; rotationMatrixToQuaternion(const Eigen::MatrixBase&lt; T &gt; &amp;r1)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00119">orientation_tools.h:119</a></div></div>
<div class="ttc" id="_math_utilities_8h_html_aa06ec79f1e3170ea41b58ffbf35b9fb6"><div class="ttname"><a href="../../de/dda/_math_utilities_8h.html#aa06ec79f1e3170ea41b58ffbf35b9fb6">almostEqual</a></div><div class="ttdeci">bool almostEqual(const Eigen::MatrixBase&lt; T &gt; &amp;a, const Eigen::MatrixBase&lt; T &gt; &amp;b, T2 tol)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/dda/_math_utilities_8h_source.html#l00023">MathUtilities.h:23</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a575819811abf1d4b8e527b22aead4013"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a575819811abf1d4b8e527b22aead4013">FloatingBaseModel::setState</a></div><div class="ttdeci">void setState(const FBModelState&lt; T &gt; &amp;state)</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00191">FloatingBaseModel.h:191</a></div></div>
<div class="ttc" id="struct_f_b_model_state_derivative_html"><div class="ttname"><a href="../../de/dce/struct_f_b_model_state_derivative.html">FBModelStateDerivative&lt; double &gt;</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a759338421e6adbe3a0a69e42271d43d4"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a759338421e6adbe3a0a69e42271d43d4">FloatingBaseModel::invContactInertia</a></div><div class="ttdeci">DMat&lt; T &gt; invContactInertia(const int gc_index, const D6Mat&lt; T &gt; &amp;force_directions)</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l01065">FloatingBaseModel.cpp:1065</a></div></div>
<div class="ttc" id="class_floating_base_model_html"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html">FloatingBaseModel&lt; double &gt;</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a1edbea0371cffe8692a83ae5a9396e41"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a1edbea0371cffe8692a83ae5a9396e41">FloatingBaseModel::applyTestForce</a></div><div class="ttdeci">T applyTestForce(const int gc_index, const Vec3&lt; T &gt; &amp;force_ics_at_contact, FBModelStateDerivative&lt; T &gt; &amp;dstate_out)</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l00962">FloatingBaseModel.cpp:962</a></div></div>
<div class="ttc" id="struct_f_b_model_state_derivative_html_af32a2041b72e6b30ed1c8a027d340fd2"><div class="ttname"><a href="../../de/dce/struct_f_b_model_state_derivative.html#af32a2041b72e6b30ed1c8a027d340fd2">FBModelStateDerivative::qdd</a></div><div class="ttdeci">DVec&lt; T &gt; qdd</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00061">FloatingBaseModel.h:61</a></div></div>
<div class="ttc" id="cpp_types_8h_html_ae2e5a0a178a2c528d8aa939f85db7a3e"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#ae2e5a0a178a2c528d8aa939f85db7a3e">DVec</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, Eigen::Dynamic, 1 &gt; DVec</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00102">cppTypes.h:102</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a202ffc31ffb2be152fbd3e7ae88e6aa6"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a202ffc31ffb2be152fbd3e7ae88e6aa6">FloatingBaseModel::_Jc</a></div><div class="ttdeci">vectorAligned&lt; D3Mat&lt; T &gt; &gt; _Jc</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00288">FloatingBaseModel.h:288</a></div></div>
<div class="ttc" id="class_floating_base_model_html_a73d58fada538f7d74ad94c48e5024b78"><div class="ttname"><a href="../../d6/db1/class_floating_base_model.html#a73d58fada538f7d74ad94c48e5024b78">FloatingBaseModel::massMatrix</a></div><div class="ttdeci">DMat&lt; T &gt; massMatrix()</div><div class="ttdef"><b>Definition:</b> <a href="../../da/de7/_floating_base_model_8cpp_source.html#l00778">FloatingBaseModel.cpp:778</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a0b83d93a3c74d282558436e26c056896"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a0b83d93a3c74d282558436e26c056896">RotMat</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 3 &gt; RotMat</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00018">cppTypes.h:18</a></div></div>
<div class="ttc" id="struct_f_b_model_state_html_ae42e1f0d68b89af761bcaf273b97bca7"><div class="ttname"><a href="../../de/d75/struct_f_b_model_state.html#ae42e1f0d68b89af761bcaf273b97bca7">FBModelState::bodyOrientation</a></div><div class="ttdeci">EIGEN_MAKE_ALIGNED_OPERATOR_NEW Quat&lt; T &gt; bodyOrientation</div><div class="ttdef"><b>Definition:</b> <a href="../../d5/d9a/_floating_base_model_8h_source.html#l00040">FloatingBaseModel.h:40</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-3" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-3-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-3-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-3-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d4/dc6/test__cheetah3__model_8cpp_a03e4dad72d0c30d97e71f4b29c1c5b1b_cgraph.png" border="0" usemap="#d4/dc6/test__cheetah3__model_8cpp_a03e4dad72d0c30d97e71f4b29c1c5b1b_cgraph" alt=""/></div>
<map name="d4/dc6/test__cheetah3__model_8cpp_a03e4dad72d0c30d97e71f4b29c1c5b1b_cgraph" id="d4/dc6/test__cheetah3__model_8cpp_a03e4dad72d0c30d97e71f4b29c1c5b1b_cgraph">
</map>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.html">home</a></li><li class="navelem"><a class="el" href="../../dir_61bfb0b3cdda81b1b0355ba34eb3b1eb.html">dhkim</a></li><li class="navelem"><a class="el" href="../../dir_adee5b101e079090017bb4e91c628ead.html">Public_Repository</a></li><li class="navelem"><a class="el" href="../../dir_7fc07a7b97001e7b1d18e11da761e2de.html">Cheetah-Software</a></li><li class="navelem"><a class="el" href="../../dir_860379c26524a894b3cf97b5b1ba5bdb.html">common</a></li><li class="navelem"><a class="el" href="../../dir_bcd721272d4e8dced7bf80a08d191b42.html">test</a></li><li class="navelem"><a class="el" href="../../d4/dc6/test__cheetah3__model_8cpp.html">test_cheetah3_model.cpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
